package com.chinamsp.dydb.query.impl;

import com.chinamsp.dydb.query.BaseSymbolConverter;
import com.chinamsp.dydb.query.FieldType;
import com.chinamsp.dydb.query.SymbolType;

/**
 * 简单类型的 操作转换
 * @author shifenghu
 *
 */
public class SimpleSymbolConverter implements BaseSymbolConverter {

	
	private SimpleSymbolConverter() {}
	
	@Override
	public String convert(String field, FieldType type, SymbolType exp) {
		// llike 和 rlike
		if (exp == SymbolType.LLK || exp == SymbolType.RLK) {
			return SymbolType.LK.getSqlExpression();
		}
		return exp.getSqlExpression();
	}


	/**
	 * 单例
	 */
	public static final BaseSymbolConverter INSTANCE = new SimpleSymbolConverter();
}
